import request from './request.js';
const VITE_API_KEY = import.meta.env.VITE_API_KEY;

// ip定位
export const getAdcode = () => {
  return request({
    method: 'get',
    url: `/ws/location/v1/ip?key=${VITE_API_KEY}`,
  });
};

// 地址解析
export const getCity = (address) => {
  return request({
    method: 'get',
    url: `/ws/geocoder/v1?key=${VITE_API_KEY}&address=${address}`,
  });
};

// 天气服务
export const getWeather = (adcode) => {
  return request({
    method: 'get',
    url: `/ws/weather/v1/?key=${VITE_API_KEY}&adcode=${adcode}&type=future`,
  });
};
